package com.lagou.util;

/**
 * @author stevejson
 *
 * http 协议请求封装
 */
public class HttpProtocolUtil {
    public static String  getHttpHeader200(Integer contentLength){
         return "HTTP/1.1 200 OK \n" +
                 "Content-Type: text/html\n"+
                 "Content-Length: "+ contentLength + "\n"+
                 "\r\n"
                 ;
    }


    public static String  getHttpHeader400(){
        String string404 = "<h1>404 not found</h1>";
        return "HTTP/1.1 400 NOT Found \n" +
                "Content-Type: text/html\n"+
                "Content-Length: "+ string404.length() + "\n"+
                "\r\n" + string404;

    }
}
